package com.gc.server.vo.down;


import lombok.Data;

import java.util.Date;

import com.alibaba.excel.annotation.*;

import java.io.Serializable;


import com.gc.server.entity.UserSchoolEntity;
import com.gc.server.vo.UserSchoolVo;


/**
 * 用户学校关系实体
 * 表名 user_school
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date ${datetime}
 */
@Data
public class UserSchoolDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    //
    @ExcelProperty("")
    private Long id;

    //学校ID
    @ExcelProperty("学校ID")
    private Long schoolId;

    @ExcelProperty("学校名")
    private String schoolName;


    @ExcelProperty("学校编号")
    private String schoolCode;

    //用户ID
    @ExcelProperty("用户ID")
    private Long userId;

    //用户ID
    @ExcelProperty("用户名")
    private String name;

    //用户ID
    @ExcelProperty("用户编号")
    private String code;

    //备注
    @ExcelProperty("备注")
    private String remark;


    public UserSchoolDown() {

    }

    public UserSchoolDown(UserSchoolVo vo) {
        UserSchoolEntity entity = vo.getEntity();
        this.setId(entity.getId());

        this.setSchoolId(entity.getSchoolId());
        if (vo.getUser() != null) {
            this.setCode(vo.getUser().getCode());
            this.setName(vo.getUser().getName());
        }
        if (vo.getSchool() != null) {
            this.setSchoolCode(vo.getSchool().getCode());
            this.setSchoolName(vo.getSchool().getName());
        }
        this.setUserId(entity.getUserId());

        this.setRemark(entity.getRemark());

    }


}
